package com.jrzh.db.migration.sys;

import com.eroi.migrate.Define;
import com.eroi.migrate.Define.DataTypes;
import com.jrzh.framework.migration.BaseMigration;
import com.jrzh.framework.migration.MigrationHelper;
/**
 * 新增系统配置表
 * @author Mr.Shower
 *
 */
public class Migration_5 extends BaseMigration{
	
	private static final String TABLE_NAME = "sys_config";
	
	@Override
	public void down() {
		log.info("##########回滚Sys模块 Migration_5##########");
		MigrationHelper.dropTable(TABLE_NAME);
	}

	@Override
	public void up() {
		log.info("##########执行Sys模块 Migration_5##########Begin");
		table(TABLE_NAME, "系统配置表", true,
				pk(),
				column("_name", "配置名称", DataTypes.VARCHAR, Define.length(256)),
				column("_key", "配置键值", DataTypes.VARCHAR, Define.length(128)),
				column("_value", "配置值", DataTypes.VARCHAR, Define.length(128)),
				column("_group", "配置组", DataTypes.VARCHAR, Define.length(128)),
				column("_data_type", "配置数据类型", DataTypes.VARCHAR, Define.length(128))
		);
		log.info("##########执行Sys模块 Migration_5##########End");
	}

}
